package thread;

/**
 * 测试线程等级问题，尽管设置了，但不一定按照预想等级执行，因为可能有其他核心先调用低等级的线程
 */
public class PriorityDemo {
    public static void main(String[] args) {
        Thread min =new Thread(){
            public  void run(){
                for (int i = 0; i < 100; i++) {
                    System.out.println("min");
                }
            }
        };

        Thread max = new Thread(){
          public void run(){
              for (int i = 0; i < 100; i++) {
                  System.out.println("max");
              }
          }
        };
        Thread norm = new Thread(){
          public void run (){
              System.out.println("norm");
          }
        };
        min.setPriority(Thread.MIN_PRIORITY);
        max.setPriority(Thread.MIN_PRIORITY);

        min.start();
        max.start();
        norm.start();
    }
}
